package mukirana;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.util.Locale;

public class Leilao {
	
	private String st="";//data hora leilao
	private boolean x=false;
	private int d=0;//tempo total do cronometro leilao
	private double p;//valor do lance atual
	private boolean e=false;
	private int id=0;//id leilao
	private int sd=0;
	private int s=0;
	private int t=0;//tempo do cronometro do leilao
	private String u="";//nome de usuario
	private int realtime=0;
	private boolean insert=false;
	
	public String getDateTimeLastLanceFormat() {
		return st;
	}
	public void setDateTimeLastLanceFormat(String st) {
		
		//String[] meses = {"Jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "Nov", "Dez"};
		
		Locale locale = new Locale("pt","BR");
    	GregorianCalendar calendar = new GregorianCalendar();
    	SimpleDateFormat formatador = new SimpleDateFormat("MM",locale);
    	
    	String dia = st.substring(0, 2 );
    	String ano = st.substring(st.indexOf(",")-4, st.indexOf(","));    	
    	String hora = st.substring(st.indexOf(",")+1, st.length());
    	String mes = formatador.format(calendar.getTime());
    	String datahoralance = ano+"-"+mes+"-"+dia+" "+hora+":00";
    	
    	//System.out.println ( datahoralance );
    	//System.exit(0);
    	
		this.st = datahoralance;
	}
	public boolean isX() {
		return x;
	}
	
	public void setX(boolean x) {
		this.x = x;
	}
	public int getTotalTime() {
		return d;
	}
	public void setTotalTime(int d) {
		this.d = d;
	}
	public double getValueLastLance() {
		return p;
	}
	public void setValueLastLance(double p) {
		this.p = p;
	}
	public boolean isE() {
		return e;
	}
	public void setE(boolean e) {
		this.e = e;
	}
		
	public int getrealTime() {
		return realtime;
	}
	public void setrealTime(int p) {
		this.realtime = p;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getDateTimeInitializeLeilao() {
		return sd;
	}
	public void setDateTimeInitializeLeilao(int sd) {
		this.sd = sd;
	}
	public int getDateTimeLastLance() {
		return s;
	}
	public void setDateTimeLastLance(int s) {
		this.s = s;
	}
	public int getTimeOnStopwatch() {
		return t;
	}
	public void setTimeOnStopwatch(int t) {
		this.t = t;
	}
	public String getUser() {
		return u;
	}
	public void setUser(String u) {
		this.u = u;
	}
	
	public boolean isInsert() {
		return this.insert;
	}
	public void setInsert( boolean insert ) {
		this.insert = insert;
	}
	
}
